-
-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix more re-used embedded docs issues #1550
Conversation
@@ -745,16 +745,6 @@ private function computeOrRecomputeChangeSet(ClassMetadata $class, $document, $r | |||
if ($orgValue !== null) { | |||
$this->scheduleOrphanRemoval($orgValue); | |||
} | |||
|
|||
if ($actualValue !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is #1542 removed because it was good only for updates (it's in the path when document is not new) while one of tests I've added was interested in fixing inserts
@@ -998,6 +988,10 @@ private function computeAssociationChanges($parentDocument, array $assoc, $value | |||
if ($assoc['type'] === ClassMetadata::ONE) { | |||
$class->setFieldValue($parentDocument, $assoc['fieldName'], $entry); | |||
$this->setOriginalDocumentProperty(spl_object_hash($parentDocument), $assoc['fieldName'], $entry); | |||
$poid = spl_object_hash($parentDocument); | |||
if (isset($this->documentChangeSets[$poid][$assoc['fieldName']])) { | |||
$this->documentChangeSets[$poid][$assoc['fieldName']][1] = $entry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixed #1542's failing test case and new one with early persist
if ($knownParent && $knownParent !== $document) { | ||
$relatedDocuments = clone $relatedDocuments; | ||
$class->setFieldValue($document, $mapping['fieldName'], $relatedDocuments); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This however I fail to see why I need to bring back but without this change set test with late persist is failing for reason I don't see yet
Thanks @malarzm ! I've removed the |
I'll comment on changes separately but as for now failing test case @redthor has provided in #1525 is fixed